package org.skavookie.spaces

import org.skavookie.linalg._

/**
 * Created by IntelliJ IDEA.
 * User: joshua
 * Date: 10/2/11
 * Time: 3:32 PM
 * To change this template use File | Settings | File Templates.
 */

trait LinearSpace[X,R] {
  val one: X
  val zero: X

  /**
   * x,y,z in X
   * x + y = y + x
   * x + (y + z) = (x + y) + z
   * x + 0 = x
   */
  def plus(x: X, y: X): X

  /**
   * x + neg(x) = 0
   */
  def neg(x: X): X

  /**
   * a in R
   * x,y in X
   * 1x = x
   * a(x + y) = ax + ay
   * ...
   */
  def times(a: R, x: X): X
}